#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr1[161] = { '\0' };
	char arr2[80] = { '\0' };

	gets(arr1);
	gets(arr2);
	int k = strlen(arr2);
	while (strstr(arr1, arr2) != NULL)
	{
		char* ptr = strstr(arr1, arr2);
		
		if (ptr == NULL)
		{
			break;
		}
		int n = strlen(ptr);
		for (int i = 0;i < n;i++)
		{
			char ch1 = *(ptr + i + k);
			
			ptr[i] = ch1;
		}
	}
	puts(arr1);
	return 0;
}